﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AgencyEntityLib.BaseEntity;
using Ecopsy.Tools;
using Ecopsy.DataTier;
using AgencyEntityLib.Context;
using System.Data.SqlClient;

namespace AgencyEntityLib.BaseEntity
{   
    class wsBusinesEngine:EntitySingle
    {
        

        public virtual BusinesRulesEngine GetBusinesRulesEngine(BusinessRulesEntity BusinessRulesEntity)
        {
            if (BusinessRulesEntity is Contract || BusinessRulesEntity  is ContractSurfaceItem)
                return Get_Contract_BusinesRulesEngine(BusinessRulesEntity);
            
            if (BusinessRulesEntity is Constraction)
                return Get_Constraction_BusinesRulesEngine(BusinessRulesEntity);

          
            return new BusinesRulesEngine ();

        }

        protected  virtual  Constraction_BusinesRulesEngine Get_Constraction_BusinesRulesEngine(BusinessRulesEntity BusinessRulesEntity)
        {
            return new Constraction_BusinesRulesEngine() { Owner = BusinessRulesEntity };
        }

        protected virtual Contract_BusinesRulesEngine Get_Contract_BusinesRulesEngine(BusinessRulesEntity BusinessRulesEntity)
        {
            return new Contract_BusinesRulesEngine() { Owner = BusinessRulesEntity };
        }
        
    }
}
